package com.hj.saapp.control.adapter;

import android.bluetooth.BluetoothDevice;

import com.hj.saapp.BCDApplication;
import com.hj.saapp.R;

import java.util.List;

/**
 * Created by "丁永泽" on 2016/9/23.
 */

public class PrintSetingAdapter extends CommonAdapter<BluetoothDevice> {



    public PrintSetingAdapter(List<BluetoothDevice> datas) {
        super(BCDApplication.getApp(), datas, R.layout.print_seting_adapter_item);
    }

    @Override
    public void convert(ViewHolder holder, BluetoothDevice bluetoothDevice) {

        holder.setText(R.id.nameTv, bluetoothDevice.getName());
        holder.setText(R.id.addrTv, bluetoothDevice.getAddress());

        if(bluetoothDevice.getBondState() == BluetoothDevice.BOND_BONDED){

            holder.setText(R.id.statusTv, "已配对");

        }else if (bluetoothDevice.getBondState() == BluetoothDevice.BOND_BONDING)
        {
            holder.setText(R.id.statusTv, "开始配对");

        }
        else {
            holder.setText(R.id.statusTv, "未绑定");
        }



    }
}
